<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>props基本使用1</title>

</head>

<body>
    <div id="test" />
    <div id="test1" />
    <div id="test2" />

    <script type="text/javascript" src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/react/18.2.0/umd/react.production.min.js"></script>
    <script type="text/javascript" src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/react-dom/18.2.0/umd/react-dom.production.min.js"></script>
    <script type="text/javascript" src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/babel-standalone/6.26.0/babel.min.js"></script>

    <script type="text/babel">
        class Person extends React.Component {
            render() {
                console.log(this)
                const {name, age, sex} = this.props
                return (
                    <ui>
                        <li>姓名: {name}</li>
                        <li>性别: {sex}</li>
                        <li>年龄: {age}</li>
                    </ui>
                )
            }
        }

        // 渲染组件到页面
        ReactDOM.render(<Person name="jerry" age={18} sex="女"/>, document.getElementById("test"))
    </script>
</body>

</html>